<?php
$task_Id =$_GET['task_id'] ?? "";

$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");

$sql = "delete from Task where TaskId='{$task_Id}'";
$result = $db->query($sql);

if ($result){
    echo "删除成功,请前往<a href='list.php'>查看</a>";
}else{
    echo "删除失败";
}
?>